home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / More Source / C⁄C++ / Notes Demo / README < prev   
Text File  |  1994-11-06  |  2KB  |  41 lines

  1. 11/4/94 - Converted to Metrowerks CodeWarrior by Paul Celestin
  2.  
  3. From the original README:
  4.  
  5. This is a small stupid demo of the sampled-note synthesizer.
  6.  
  7. Compile and link in the ANSI library. Run it. Hit RETURN to start playing, and RETURN
  8. again to stop playing and quit the program.
  9.  
  10. (This was done in Think C 5.0.4. I don't know
  11. what the appropriate magic is in other environments to get ANSI-style IO; at worst,
  12. you can get rid of the printf() and gets() statements in main.c. Make sure you put
  13. in a long delay at the end, or some kind of wait-until-user-quits command; otherwise
  14. the program will start up and quit immediately, without enough time to play the
  15. (asynchronous) music.)
  16.  
  17. SND resources 9000-9003 are sampled sounds; each has a loopback interval set, so they
  18. can be stretched to any length. (Any SND editor, such as SoundEdit, should have an
  19. option to set the loopback.) 
  20.  
  21. SND resources 9008-9011 are the notes definitions. Each is a list of 
  22. freqDurationCmds, nothing more. (A rest is indicated by a quietCmd followed
  23. by a restCmd. I'm not certain whether the quietCmd is necessary; I haven't tried
  24. it without it.)
  25.  
  26. The program flow is pretty simple. It allocates four channels; it sets a sampled
  27. sound on each, by sending a soundCmd; then it sends the sequences of notes to
  28. each, using the SndPlay function to send the freqDurationCmds in the SND resources
  29. 9008-9011. Then it sits and waits for the user to hit RETURN. (Once started, the
  30. sounds play asynchronously.)
  31.  
  32. This code is badly documented, probably leaks memory, and is certainly confusing.
  33. It's from a project which is about one tenth completed. Don't you dare blame me
  34. for anything.
  35.  
  36. The musAnalyzeSnd function is a direct C translation of GetSndDataOffset in
  37. Jim Reekes's SoundApp program. SNDs 9008-9011 are also copied from SoundApp.
  38. The four sampled sounds are my voice, mangled. 
  39.  
  40. Written by Andrew Plotkin (ap1i+@andrew.cmu.edu)
  41.